package com.z1.core.swagger;

import com.z1.core.utils.ApplicationPropUtils;

import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;

public class SwaggerConfig {
	
    protected ApiInfo apiInfo() {
    	String title = ApplicationPropUtils.getProperty("title", "");
    	String description = ApplicationPropUtils.getProperty("description", "");
    	String version = ApplicationPropUtils.getProperty("version", "");
    	String contactName = ApplicationPropUtils.getProperty("contact.name", "");
    	String contactUrl = ApplicationPropUtils.getProperty("contact.url", "");
    	String contactEmail = ApplicationPropUtils.getProperty("contact.email", "");
    	
    	return new ApiInfoBuilder()
    		.title(title)
    		.description(description)
    		.license("")
    		.licenseUrl("")
    		.termsOfServiceUrl("")
    		.version(version)
    		.contact(new Contact(contactName, contactUrl, contactEmail))
    		.build();
    }
    
}
